-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Don't complain on a single non-exhaustive 1-ZST #115924
Conversation
This comment has been minimized.
This comment has been minimized.
error: zero-sized fields in `repr(transparent)` cannot contain external non-exhaustive types | ||
--> $DIR/repr-transparent-non-exhaustive.rs:102:31 | ||
| | ||
LL | pub struct T18(NonExhaustive, NonExhaustive); | ||
| ^^^^^^^^^^^^^ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems fine to land this for now to fix the regression, but could you file a diagnostics issue about this? The error says "zero-sized fields [...] cannot contain external non-exhaustive types" but that's not really accurate, some zero-sized fields can in fact contain such non-exhaustive types.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
54c33d3
to
537834d
Compare
// Okay, since there's only 1 foreign non-exhaustive type. | ||
|
||
#[repr(transparent)] | ||
pub struct T22Flipped(NonExhaustive, InternalPrivate); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is identical to T22
...?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copy paste issue 🤦
Should I just give these structs better names while we're at it? Like, the whole file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you have good naming ideas, sure, why not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nothing comes to mind actually that isn't incredibly verbose. 😓
r=me after fixing the test |
537834d
to
fd36553
Compare
@bors r=RalfJung |
…llaumeGomez Rollup of 6 pull requests Successful merges: - rust-lang#112725 (rustdoc-search: add support for type parameters) - rust-lang#114941 (Don't resolve generic impls that may be shadowed by dyn built-in impls) - rust-lang#115625 (Explain HRTB + infer limitations of old solver) - rust-lang#115839 (Bump libc to 0.2.148) - rust-lang#115924 (Don't complain on a single non-exhaustive 1-ZST) - rust-lang#115946 (panic when encountering an illegal cpumask in thread::available_parallelism) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#115924 - compiler-errors:non-exhaustive-1-zst, r=RalfJung Don't complain on a single non-exhaustive 1-ZST r? RalfJung, though you mentioned being busy, so feel free to reassign. This doesn't actually attempt to make the diagnostic better, so when we have two non-exhaustive 1-ZSTs in a struct, we still just point to one. 🤷 Fixes rust-lang#115922
r? RalfJung, though you mentioned being busy, so feel free to reassign.
This doesn't actually attempt to make the diagnostic better, so when we have two non-exhaustive 1-ZSTs in a struct, we still just point to one. 🤷
Fixes #115922